package com.bidevalution.business.dto;

import lombok.Data;

@Data
public class WebSocketSendTimeKeyDto {
    private String chandId;
    private String action;
    private String md5;
    public static WebSocketSendTimeKeyDto parse(String key) {
        int i = 0;
        String[] keys = key.split("#");
        WebSocketSendTimeKeyDto webSocketSendTimeKeyDto = new WebSocketSendTimeKeyDto();
        webSocketSendTimeKeyDto.md5 = keys[i++];
        webSocketSendTimeKeyDto.action = keys[i++];
        webSocketSendTimeKeyDto.chandId = keys[i++];

        return webSocketSendTimeKeyDto;
    }

    public static String getKey(String chandId, String action, String md5) {
        return String.format("%s#%s#%s", md5, action, chandId);
    }

}
